const  fs=require('fs');
const rs=fs.createReadStream('./test1.txt');
const ws=fs.createWriteStream('./test3.txt');
rs.on('open',()=>{
    console.log('可读流打开');
})
rs.on('close',()=>{
    console.log('可读流关闭');
    // ws.end();
})

rs.on('data',data=>{
console.log('data');
console.log(data.toString());
})
ws.on('open',()=>{
    console.log('可写流打开');
})
ws.on('close',()=>{
    console.log('可写流关闭');
})
rs.on('data',(data)=>{
    console.log(data);
    ws.write(data);
})